package com.sgb.kjwl.di.category;

import com.sgb.kjwl.repository.CategoryRepertory;
import com.sgb.kjwl.repository.impl.CategoryRepertoryImpl;
import com.sgb.kjwl.view.ui.fragment.CategoryFragment4;
import com.sgb.kjwl.view.ui.fragment.CategoryLeaseFragment;
import com.sgb.kjwl.viewmodel.category.CategoryFragModel4;
import com.sgb.kjwl.viewmodel.category.CategoryLeaseFragmentModel;
import com.swgk.core.base.di.Fragment;
import com.swgk.core.base.api.BaseApiSource;
import com.swgk.core.base.model.preference.BasePreferenceSource;

import dagger.Module;
import dagger.Provides;

@Module
public class CategoryFragModule {
    private CategoryFragment4 categoryFragment4;
    private CategoryLeaseFragment categoryLeaseFragment;

    public CategoryFragModule(CategoryFragment4 categoryFragment4) {
        this.categoryFragment4 = categoryFragment4;
    }

    public CategoryFragModule(CategoryLeaseFragment categoryLeaseFragment) {
        this.categoryLeaseFragment = categoryLeaseFragment;
    }

    @Provides
    @Fragment
    CategoryRepertory provideCategoryRepertory(BaseApiSource apiSource, BasePreferenceSource preferenceSource) {
        return new CategoryRepertoryImpl(apiSource, preferenceSource);
    }

    @Provides
    @Fragment
    CategoryFragModel4 categoryFragModel4(CategoryRepertory repertory) {
        return new CategoryFragModel4(categoryFragment4, repertory);
    }

    @Provides
    @Fragment
    CategoryLeaseFragmentModel provideCategoryLeaseFragmentModel(CategoryRepertory repertory) {
        return new CategoryLeaseFragmentModel(categoryLeaseFragment, repertory);
    }
}

